import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static String fun(double n, int m) {
        String s = "%." + String.valueOf(m) + "f";
        return String.format(s, n);
    }

    public static void fun2(int n){
        List<Integer> list = new ArrayList<>();
        while(n>0){
            list.add(n%10);
            n/=10;
        }
        for(int i=list.size()-1;i>=0;i--){
            System.out.print(list.get(i));
            System.out.print(' ');
        }
        System.out.println();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        fun2(n);
    }
}